Mule : File Provider
This page last changed on Nov 07, 2006 by ross.
The file connector allows files to be read and written to and from directories on the local file system. The connector can be configured to filter the file it reads and the way files are written, such as whether binary output is used or the file is appended to. The javadoc for this transport provider can be found here . And the Source Xref can be found here . File Connector Properties
File EndpointsFile endpoints are expressed using standard File URI syntax - file://<path>[?params] For example, to connect to a directory called /temp/files - Unix file:///temp/files Note the extra slash to denote a path from the root (absolute path). Windows file:///C:/temp/files The Unix style will still work in Windows if you map to a single drive (the one Mule was started from). To specify a relative path use - file://./temp or file://temp (note only 2 slashes for protocol, so it's a relative path, the above syntax is preferred for readability) or file://?address=./temp Windows network URIs file:////192.168.0.1/temp/ Filename FiltersFilters can be set on the endpoint to control what files are received by the endpoint. The filters are expressed in a comma-separated list. To set up a filter to only read .xml and .txt files the following can be used. <endpoint address="file:///inbound/myfiles"> <filter pattern="*.txt,*.xml" className="org.mule.providers.file.filters.FilenameWildcardFilter"/> </endpoint> Property OverridesYou can override certain properties when defining a File receiver endpoint to control the way that particular receiver behaves. the properties that can be set on the individual endpoint are moveToDirectory, moveToPattern, pollingFrequency and autoDelete. <endpoint address="file:/./temp/myfiles"> <properties> <property name="pollingFrequency" value="30000"/> <property name="moveToDirectory" value="./temp/myfiles/done"/> </properties> </endpoint> Or to specify the same Endpoint using an URI -
file:/./temp/myfiles?pollingFrequency=1000&moveToDirectory=./temp/myfiles/done
TransformersTransformers for the File provider can be found at org.mule.providers.file.transformers.
The FileToByteArray is used if no other transformers are specified. It could also return the byte array as a String if the component request it. |
Document generated by Confluence on Nov 27, 2006 10:27 |